﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace SmallERP.Host
{
    public partial class FrmHistorData : Form
    {
       
        public FrmHistorData()
        {
            InitializeComponent();
        }

        private void btnOK_Click(object sender, EventArgs e)
        {
            Save();
        }
        private void Save()
        {
            if (string.IsNullOrEmpty(txtDays.Text))
            {
                txtDays.Focus();
                MessageBox.Show("请输入天数","提示",MessageBoxButtons.OK,MessageBoxIcon.Information);
                return;
            }
            Properties.Settings.Default.HistoryDataSaveDays =Convert.ToInt32(txtDays.Text);
            Properties.Settings.Default.Save();
          
            MessageBox.Show("设置成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
            this.Close();
        }

        private void FrmHistorData_Load(object sender, EventArgs e)
        {
            txtDays.Text = Properties.Settings.Default.HistoryDataSaveDays.ToString();
        }
    }
}
